home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Plotting / aa_Intel_Only / Gnuplot / GnuplotSource / SubObject.m < prev    next >
Encoding:
Text File  |  1995-06-12  |  1.2 KB  |  80 lines

  1. /*
  2.  *  Copyright (C) 1993  Robert Davis
  3.  *
  4.  *  This program is free software; you can redistribute it and/or
  5.  *  modify it under the terms of Version 2, or any later version, of 
  6.  *  the GNU General Public License as published by the Free Software 
  7.  *  Foundation.
  8.  */
  9.  
  10.  
  11. static char RCSId[]="$Id: SubObject.m,v 1.3 1993/05/04 16:22:59 davis Exp $";
  12.  
  13.  
  14. #import <objc/hashtable.h>    /* NXCopyStringBufferFromZone()    */
  15. #import <objc/zone.h>
  16.  
  17. #import "SubObject.h"
  18.  
  19. @implementation SubObject
  20.  
  21. - init
  22. {
  23.     [super init];
  24.     stringValue = NULL;
  25.     return self;
  26. }
  27.  
  28.  
  29. - initFromString:(const char *)aString
  30. {
  31.     [super init];
  32.  
  33.     [self setStringValue:aString];
  34.     return self;
  35. }
  36.  
  37.  
  38. - free
  39. {
  40.     NXZoneFree ([self zone], stringValue);
  41.     return [super free];
  42. }
  43.  
  44.  
  45. - setStringValue:(const char *)aString
  46. {
  47.     NXZone *zone = [self zone];
  48.  
  49.     NXZoneFree (zone, stringValue);
  50.  
  51.     if (aString && *aString)
  52.     stringValue = NXCopyStringBufferFromZone (aString, zone);
  53.     else
  54.     stringValue = NULL;
  55.  
  56.     return self;
  57. }
  58.  
  59.  
  60. - (const char *)stringValue
  61. {
  62.     return stringValue;
  63. }
  64.  
  65.  
  66. - (BOOL)isAttachment
  67. {
  68.     return NO;
  69. }
  70.  
  71.  
  72. // Shuts up the compiler about unused RCSId
  73. - (const char *) rcsid
  74. {
  75.     return RCSId;
  76. }
  77.  
  78.  
  79. @end
  80.